<include file="public@header"/>
<style>
    .table img {
        width: 50px;
    }

    .layui-tab.back {
        margin-bottom: 10px;
    }

    .back a {
        color: #969696;
    }

    .cinfo {
        display: -webkit-flex; /* Safari */
        display: flex;
    }

    .cinfo_l {
        display: -webkit-flex; /* Safari */
        display: flex;
        justify-content: center;
        align-items: center;
        margin-right: 20px;
        width: 200px;
        height: 130px;
    }

    .cinfo_l img {
        max-width: 100%;
        max-height: 100%;
    }

    .cinfo_r {
        flex: 1;
        display: -webkit-flex; /* Safari */
        display: flex;

        -webkit-box-orient: vertical;
        -webkit-box-direction: normal;
        -ms-flex-direction: column;
        flex-direction: column;

    }

    .cinfo_name {
        flex: 1;
        color: #323232;
        font-size: 16px;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        font-weight: 600;
    }

    .detail td{
        border-width: 0;
    }

    .trade_item_list{
        display: -webkit-flex; /* Safari */
        display: flex;
        justify-content: center;
        align-items: center;
    }
    .trade_item_list .trade_item{
        flex: 1;
    }
    .trade_item_v{
        font-size: 16px;
        font-weight: bold;
    }
    .js_tips{
        margin-left: 10px;
    }
</style>
</head>
<body>
<div class="layui-fluid">
    <div class="layui-row">

        <div class="layui-page-content">
            <div class="layui-card">
                <div class="layui-card-body">
                    <div class="layui-tab layui-tab-brief back">
                        <if condition="$data.o_top_type_id == 1">
                            <a href="{:url('merchant.cate/index')}">返回</a>
                            <elseif condition="$data.o_top_type_id == 3">
                                <a href="{:url('merchant.serve/index')}">返回</a>
                                <elseif condition="$data.o_top_type_id == 4">
                                    <a href="{:url('merchant.look_shop/index')}">返回</a>
                                    <elseif condition="in_array($data.o_top_type_id,[5,6,7,8])">
                                        <a href="{:url('merchant.supermarket/index')}">返回</a>
                                        <else/>
                        </if>
                    </div>
                    <div class="cinfo">
                        <div class="cinfo_l">
                            <img src="{$data['thumb']}">
                        </div>
                        <div class="cinfo_r">
                            <div class="cinfo_name">{$data['name']}</div>
                            <div class="cinfo_btn">
                                <a class="layui-btn layui-btn-sm"  href="javascript:admin.openIframeLayer('{:url('merchant.cate/ReadIndustry',array('id'=>$data['id']))}','资质',{area:['60%', '600px'],end:function(){}})">资质</a>
                            </div>
                        </div>

                        <table class="layui-table table-hover table-bordered table-list detail" lay-even="" lay-size="lg">
                            <tbody>
                            <tr style="border-width: 0;">
                      
                                <td>
                                    <span style="font-weight: 600;">类型:</span>
                                    {$data['store_type']['name'] ?? '--'}
                                </td>
                                <td>
                                    <span style="font-weight: 600;">总评:</span>
                                    {$data['remark'] ?? '--'}
                                </td>
                            </tr>
                            <tr>
                   
                                <td>
                                    <span style="font-weight: 600;">口味|包装|配送满意度:</span>
                                    {$taste_star}|{$packaging_star}|{$distribution_star}
                                </td>
                                <td>
                                    <span style="font-weight: 600;">营业时间:</span>
                                    {$businessHours}
                                </td>
                            </tr>
                            <tr>
                                <td>
                                    <span style="font-weight: 600;">地址:</span>
                                    {$data['address']}
                                </td>
                            </tr>
                            </tbody>
                        </table>

                    </div>
                </div>
            </div>
        </div>

        <div class="layui-page-content">

            <div class="layui-card">
                <div class="layui-tab layui-tab-brief">
                    <ul class="layui-tab-title">
                        <li><a href="{:url("merchant.cate/read",["type"=>"now",'id'=>$data['id']])}">当前订单</a></li>
                        <li><a href="{:url("merchant.cate/read",["type"=>"before",'id'=>$data['id']])}">过往订单</a></li>
                        <li><a href='{:url("merchant.cate/evaluateIndex",['id'=>$data['id']])}'>评价列表</a></li>
                        <li><a class="layui-this">商品列表</a></li>
                        <li><a href='{:url("merchant.cate/storeType",['id'=>$data['id']])}'>店铺分类</a></li>
                    </ul>
                </div>

                <div class="layui-card">
                    <div class="layui-card-body">
                        <form class="layui-form" method="get" action="{:url("merchant.cate/product",['id'=>$data['id']])}">
                        <div class="layui-form-item layuiadmin-card-text" style="margin-bottom: 0;">

                            <div class="layui-inline">
                                <label class="layui-form-label">店铺分类</label>
                                <div class="layui-input-inline">
                                    <select class="form-control layui-input" name="store_type_id">
                                        <option value='0'>全部</option>
                                        <volist name="store_type_list" id="v">
                                            <option <eq name="$store_type_id" value="$v.id">selected</eq> value='{$v.id}'>{$v.name}</option>
                                        </volist>
                                    </select>
                                </div>
                            </div>

                            <div class="layui-inline">
                                <label class="layui-form-label">是否上架</label>
                                <div class="layui-input-inline">
                                    <select class="form-control layui-input" name="show">
                                        <option value='0'>全部</option>
                                        <option <eq name="$show" value="1">selected</eq> value='1'>是</option>
                                        <option <eq name="$show" value="2">selected</eq> value='2'>否</option>
                                    </select>
                                </div>
                            </div>

                            <div class="layui-inline">
                                <label class="layui-form-label">商品ID</label>
                                <div class="layui-input-inline">
                                    <input type="text" class="layui-input" name="product_id" value="{:input('product_id')}"
                                           autocomplete="off" placeholder="商品ID">
                                </div>
                            </div>
                            <div class="layui-inline">
                                <label class="layui-form-label">商品价格</label>
                                <div class="layui-input-inline">
                                    <input type="text" class="layui-input" name="price" value="{:input('price')}"
                                           autocomplete="off" placeholder="当前价格以下">
                                </div>
                            </div>

                            <div class="layui-inline">
                                <div class="layui-input-inline">
                                    <input type="submit" class="layui-btn btn-primary" value="搜索" />
                                    <a class="layui-btn layui-btn-danger btn-danger" href="{:url("merchant.cate/product",['id'=>$data['id']])}">清空</a>
                                </div>
                            </div>
                        </div>
                        </form>
                    </div>
                </div>
            </div>

            <div class="layui-card-body">
                <form method="post" class="js-ajax-form" method="post">
                    <table class="layui-table table-hover table-bordered table-list" id="menus-table" lay-even=""
                           lay-size="lg">
                        <thead>
                        <tr>
                            <th width="80">ID</th>
                            <th>名称</th>
                            <th>平台分类</th>
                            <th>店铺分类</th>
                            <th>图片</th>
                            <th>价格</th>
                            <th>总|月销量</th>
                            <th>赞|踩数量</th>
                            <th>添加时间</th>
                            <th>上架状态</th>
                            <th align="center">{:lang('ACTIONS')}</th>
                        </tr>
                        </thead>
                        <tbody>
                        <volist name="list" id="vo">
                            <tr>
                                <td>
                                    {$vo['id']}
                                </td>
                                <td>{$vo['name']}</td>
                                <td>{$vo['type_info']['name'] ?? '--'}</td>
                                <td>{$vo['store_type_info']['name'] ?? '--'}</td>
                                <td>
                                    <foreach name="$vo.image" item="item">
                                        <notempty name="item">
                                            <a href="javascript:admin.imagePreviewDialog('{$item}');">
                                                <i class="icon-icon layui-icon-md-images"></i>
                                            </a>
                                            <else/>
                                            <a><i class="icon-icon layui-icon-md-close"></i></a>
                                        </notempty>
                                    </foreach>
                                </td>
                                <td>{$vo['price']}</td>
                                <td>{$vo['all_sales']}|{$vo['monthly_sales']}</td>
                                <td>
                                    {$vo['tag_praise']}|{$vo['tag_tread']}
                                </td>
                                <td>{$vo['add_time']}</td>
                                <td>
                                    {$vo['is_show']}
                                </td>
                                <td>
                                    <if condition="$vo['o_is_show']">
                                        <a class="layui-bo layui-bo-checked layui-bo-small js-ajax-delete" data-msg="确定此项操作?" href="{:url('merchant.cate/productSetShow',array('id'=>$vo['id'],'is_show'=>0))}">下架</a>
                                    <else/>
                                        <a class="layui-bo layui-bo-checked layui-bo-small js-ajax-delete" data-msg="确定此项操作?" href="{:url('merchant.cate/productSetShow',array('oid'=>$vo['id'],'is_show'=>1))}">上架</a>
                                    </if>
                                    <a class="layui-bo layui-bo-checked layui-bo-small" href="javascript:admin.openIframeLayer('{:url('merchant.cate/productAttr',array('id'=>$vo['id']))}','商品规格',{area:['60%', '600px'],end:function(){}})">商品规格</a>
                                    <a class="layui-bo layui-bo-checked layui-bo-small" href="javascript:admin.openIframeLayer('{:url('merchant.cate/productReplyDetail',array('id'=>$vo['id']))}','赞踩详情',{area:['60%', '600px'],end:function(){}})">赞踩详情</a>
                                    <a class="layui-bo layui-bo-small layui-bo-close js-ajax-delete" href="{:url('merchant.storeProduct/delete',array('id'=>$vo['id']))}">{:lang('DELETE')}</a>
                                </td>
                            </tr>
                        </volist>
                        </tbody>
                    </table>
                    <div class="pagination">{$page}</div>
                </form>
            </div>

        </div>
    </div>

</div>

</div>
<include file="public@script"/>
<script>
    (function (){
        $('.js_tips').mouseover(function (){
            let _that=$(this);
            let tip=_that.data('tip');
            layer.tips(tip, _that);
        })
    })()
</script>
</body>
</html>